"use strict";

const Controller = require("egg").Controller;

class DemoController extends Controller {
  // 查询信息列表
  async list() {
    const { ctx } = this;
    const query = ctx.request.query;
    const data = await ctx.service.system.loginLog.list(query);
    ctx.body = data;
  }
  // 查询信息详细
  async detail() {
    const { ctx } = this;
    const query = ctx.request.query;
    const data = await ctx.service.system.loginLog.detail(query);
    ctx.body = data;
  }
  // 新增信息
  async add() {
    const { ctx } = this;
    const body = ctx.request.body;
    const data = await ctx.service.system.loginLog.add(body);
    ctx.body = data;
  }
  // 修改信息
  async update() {
    const { ctx } = this;
    const body = ctx.request.body;
    const data = await ctx.service.system.loginLog.update(body);
    ctx.body = data;
  }
  // 删除信息
  async delete() {
    const { ctx } = this;
    const query = ctx.request.query;
    const data = await ctx.service.system.loginLog.delete(query);
    ctx.body = data;
  }

  // // 批量删除信息
  // async batchDelete() {
  //   const { ctx } = this;
  //   const body = ctx.request.body;
  //   const data = await ctx.service.system.loginLog.batchDelete(body);
  //   ctx.body = data;
  // }
}

module.exports = DemoController;
